package com.cqx.collectionMysql.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 客户端枚举
 * @author chen.ping
 * @version 1.0
 */
public enum ClientEnum {
    MERCHANT(0, "商户端", "MERCHANT"), USER(1, "用户端", "USER"),MERCHANTPC(2, "商户PC端", "MERCHANTPC");
    @Getter
    private Integer index;
    @Getter
    private String name;
    @Getter
    private String describe;

    ClientEnum(Integer index, String name, String describe) {
        this.index = index;
        this.name = name;
        this.describe = describe;
    }

    public static ClientEnum getClientEnum(Integer index) {
        return Arrays.stream(ClientEnum.values()).filter(x -> x.getIndex().equals(index)).findFirst().get();
    }
}
